from bottle import route, run, template

@route('/')
def index():
    return '''<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Welcome</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        h1 {
            font-size: 36px;
        }
        .content {
            position: relative;
            padding-left: 30px;
            color: #D4001E;
        }
        .content::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 0;
            transform: translateY(-50%);
            width: 10px;
            height: 168px;
            background-color: #D4001E;
        }
    </style>
</head>
<body>
    <div class="content">
        <img src="" alt="天翼云">
        <h1>Welcome to Bottle!</h1>
        <p>本应用由天翼云函数计算Serverless应用创建</p>
    </div>
</body>
</html>'''

@route('/hello/<name>')
def index(name):
    return template('<b>Hello {{name}}</b>!', name=name)

run(host='0.0.0.0', port=8080)